<form class="layui-form" onsubmit="return false;">
    <input type="hidden" name="bean.id" value="#(bean.id)">
    <input type="hidden" name="bean.orgId" value="#(bean.orgId)">
	<div class="main-container">
		<div class="layui-form-item">
		    <div class="layui-inline">
				<label class="layui-form-label required">账号</label>
				<div class="layui-input-inline">
					<input type="text" name="bean.accountName" value="#(bean.accountName)" lay-verify="required" autocomplete="off" placeholder="请输入登录账号" class="layui-input">
				</div>
		        <label class="layui-form-label required">状态</label>
		        <div class="layui-input-inline">
		            <input type="radio" name="bean.status" value="on" title="启用" #if(bean.status == 'on' || bean.status == null) checked #end>
		            <input type="radio" name="bean.status" value="off" title="禁用" #if(bean.status == 'off') checked #end>
		        </div>
			</div>
		</div>
		<div class="layui-form-item">
		    <div class="layui-inline">
				<label class="layui-form-label required">昵称</label>
				<div class="layui-input-inline">
					<input type="text" name="bean.nickname" value="#(bean.nickname)" lay-verify="required" autocomplete="off" placeholder="请输入昵称" class="layui-input">
				</div>
                <label class="layui-form-label required">部门</label>
                <div class="layui-input-inline">
                    <input type="text" name="bean.orgId" lay-filter="org-select" value="#(bean.orgId)" lay-verify="required" class="layui-input">
                </div>
            </div>
		</div>
		<div class="layui-form-item">
		    <div class="layui-inline">
				<label class="layui-form-label #if(!bean.id)required#end">#if(!bean.id)登录密码#else重置密码#end</label>
				<div class="layui-input-inline">
					<input type="password" name="newPassword" lay-verify="password#if(!bean.id)|required#end" autocomplete="off" placeholder="#if(!bean.id)请输入登录密码#else请谨慎重置密码#end" class="layui-input">
				</div>
				<label class="layui-form-label #if(!bean.id)required#end">确认密码</label>
				<div class="layui-input-inline">
					<input type="password" name="confirmPassword" lay-verify="password#if(!bean.id)|required#end" autocomplete="off" placeholder="请输入确认密码" class="layui-input">
				</div>
			</div>
		    #if(bean.id)
            <div class="layui-inline">
                <label class="layui-form-label">管理员密码</label>
                <div class="layui-input-inline">
                    <input type="password" name="adminPassword" lay-verify="password" autocomplete="off" placeholder="请输入管理员密码" class="layui-input">
                </div>
            </div>
            #end
		</div>
		<div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">手机</label>
                <div class="layui-input-inline">
                    <input type="text" name="bean.mobile" value="#(bean.phone)" lay-verify="" autocomplete="off" placeholder="请输入手机号码" class="layui-input">
                </div>
                <label class="layui-form-label">电话</label>
                <div class="layui-input-inline">
                    <input type="text" name="bean.phone" value="#(bean.phone)" lay-verify="" autocomplete="off" placeholder="请输入电话号码" class="layui-input">
                </div>
            </div>
		</div>
		<div class="layui-form-item">
            <label class="layui-form-label">说明</label>
            <div class="layui-input-block">
                <textarea name="bean.remark" placeholder="请输入说明内容" class="layui-textarea">#(bean.remark)</textarea>
            </div>
		</div>
	</div>
	<div class="layui-form-item" style="display: none;">
        <div class="layui-input-block">
			<button type="submit" class="pear-btn pear-btn-primary pear-btn-sm" lay-submit="" lay-filter="data-save" id="data-save">
				<i class="layui-icon layui-icon-ok"></i> 提交
			</button>
		</div>
	</div>
</form>
#include("/admin/_common/foot.html")
<script type="text/javascript">
layui.use(['jquery', 'form', 'common', 'treeSelect'], function() {
    var $ = layui.jquery;
    var form = layui.form;
    var common = layui.common;
    var treeSelect = layui.treeSelect;
    
    // 模块操作路径
    var MODULE_PATH = "#(ctxPath)/admin/system/org/";

    // 初始化上级下拉选择器
    treeSelect.render({
        elem: '[lay-filter="org-select"]', // css选择器，推荐使用id
        data: MODULE_PATH + 'tree', // 请求地址
        type: 'get', // ajax请求方式：post/get
        search: true, // 是否开启搜索功能：true/false，默认false
        key: {
            id: 'id', // 返回数据中主键的属性名称，默认值为id
        },
        click: function (data) { // 节点点击回调函数
        },
        style: {
            folder: {
                enable: false
            },
            line: {
                enable: true
            }
        },
        // 加载完成后的回调函数
        success: function (d) {
            // lay-filter值做为被操作对象ID
            treeSelect.checkNode('org-select', '#(bean.orgId)');
            treeSelect.refresh('org-select');
        }
    });
});
</script>
